﻿<%@ Page Language="C#" AutoEventWireup="True" CodeBehind="HospitalSelect.aspx.cs" Inherits="EarlyWarning_HospitalSelect" %>
<html>
<head>
<title>医院选取</title>
    <link rel="stylesheet" type="text/css" href="../style.css" />
    <link rel="Stylesheet" type="text/css" href="../style-floating.css" />
    <link rel="Stylesheet" type="text/css" href="../Style/global.css" />
    
    <script type="text/javascript" src="../Scripts/jquery.js"></script>
    <script type="text/javascript" src="../Scripts/MainListSelect.js"></script>
    <script type="text/jscript">
        
        function addCompanyInfo() {


            CheckBoxList = document.getElementsByName("chkHospital");
            var resultValue = "", nameList = "", idList = "";

            for (var i = 0; i < CheckBoxList.length; i++) {
                if (CheckBoxList[i].checked) {
                    resultValue = CheckBoxList[i].value;
                    tempId = resultValue.split("|")[0];
                    tempName = resultValue.split("|")[1];

                    idList = idList + tempId + ",";
                    nameList = nameList + tempName + ",";
                }
            }

            var CompanyInfo;
            if (idList.length > 1 && nameList.length>1) {
                idList = idList.substring(0, idList.length-1);
                nameList = nameList.substring(0, nameList.length-1);
            }
            CompanyInfo = nameList + "|" + idList;
            window.opener.InsertHospital(CompanyInfo);
            window.close();
        }

    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="tabcontent">
    <center>
         <table border="0" width="50%">
                  <tr align="center">
                  
                      <td class="mainlist"> 医院名称:<asp:TextBox ID="txtHospital" runat="server"></asp:TextBox>
                           <asp:Button ID="btnEnter" runat="server" Text="查询" onclick="btnEnter_Click" />
                      </td>
                  </tr>
                  <tr>
                    <td align="center">
                        <asp:GridView ID="gridInfo" runat="server" AutoGenerateColumns="false" 
                            CssClass="mainlist" Width="100%">
                        <Columns>
                         <asp:TemplateField HeaderText=" ">
                            <HeaderTemplate>
                                <input id="chkAllCompany" name="chkAll" type="checkbox" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <input id="chkHospital" name="chkHospital" type="checkbox" value='<%#Eval("HospitalID") %>|<%# Eval("HospitalName") %>'>
                                </input>
                            </ItemTemplate>
                         </asp:TemplateField>
                         <asp:BoundField HeaderText="医院名称" DataField="HospitalName" />
                    </Columns>
              </asp:GridView>
                    </td>
                  </tr>
                  <tr>
                    <td align="center">
                        <input type="button" id="Save" onclick="javascript:addCompanyInfo()" value="保存" />
                    </td>
                  </tr>
              </table>
              </center>
    </div>
     <div class="page">
        <webdiyer:AspNetPager ID="AspNetPager1" runat="server" 
             onpagechanged="AspNetPager1_PageChanged" PageSize="30" 
            >
        </webdiyer:AspNetPager>
    </div>
    </form>
</body>
</html>
